﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="VoucherCount.aspx.cs" Inherits="Main_Reports_Accounts_VoucherCount" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">
    <title></title>
    <link href="../../../Styles/accounts.css" rel="stylesheet" type="text/css" />
   <style type="text/css">
   
   </style>
    <script type="text/javascript">

        function printPartOfPage() {

            var mainDiv = document.getElementById("MainDiv").innerHTML;
            var windowUrl = 'about:blank';
            var uniqueName = new Date();
            var windowName = 'Print' + uniqueName.getTime();
            var printWindow = window.open(windowUrl, windowName, 'left=100,top=100,resizable=1,Scroll=1,width=800,height=600');
            printWindow.document.write('<html><head><style type=text/css>#grdDisplay thead{display:table-header-group;} #grdDisplay tbody{display:table-row-group;} #grdDisplay th {border:red 1px solid}</style></head><body>' + mainDiv + '<body></html>');
            printWindow.document.close();
            printWindow.focus();
            printWindow.print();
//            printWindow.close();
            return false;
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div  id="div" style="margin-left:15px;margin-top :20px;">
    <asp:HyperLink ID="hpr" NavigateUrl="#" runat="server" Text="Print" onclick=" return printPartOfPage();"></asp:HyperLink>
    </div>
    <div id="MainDiv" style="margin-left: 20%; margin-right: 20%; width: 60%">
        
        <table width="98%">
            <tr>
                <td align="center" style="width: 100%">
                    <asp:Label ID="lblCompanyName" runat="server" Font-Bold="true" Font-Size="Small"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    
                    <center>
                        <asp:Label ID="lblHeading" runat="server"></asp:Label></center>
                </td>
            </tr>
            <tr>
                <td style="width: 100%">
                    <asp:GridView ID="grdDisplay" CssClass="gridview" runat="server" ShowFooter="true"
                        ShowHeader="true" Width="98%" AutoGenerateColumns="false" OnRowDataBound="grddisplay_RowDataBound">
                        <Columns>
                            <asp:TemplateField HeaderText="S.No.">
                                <ItemTemplate>
                                    <%# Container.DataItemIndex + 1 %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="Particulars" DataField="TransactionName" ItemStyle-Width="68%"
                                ItemStyle-HorizontalAlign="Left" />
                            <asp:BoundField HeaderText="Voucher Count" DataField="VoucherCount" ItemStyle-Width="10%"
                                ItemStyle-HorizontalAlign="Right" />
                            <asp:BoundField HeaderText="Last Date" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center"
                                DataField="LastDate" DataFormatString="{0:dd-MMM-yyyy}" />
                        </Columns>
                    </asp:GridView>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
